As a photoelectric sensor equipped with a photoelectric element for receiving the light projected from a light projecting element, the photoelectric sensor described in Patent Document 1, for example, is available. A circuit board on which a photoelectric element is mounted is accommodated inside the case of this photoelectric sensor. Furthermore, the case holds a condensing lens for condensing light toward the photoelectric element. The photoelectric element is mounted on the face of the circuit board on the opposite side of the condensing lens, and a through hole is formed in the circuit board at the position between the condensing lens and the photoelectric element. In this photoelectric sensor, the light condensed by the condensing lens passes through the through hole of the circuit board and reaches the photoelectric element. The photoelectric sensor then detects an object to be detected on the basis of the change in the amount of the light received by the photoelectric element.
However, the side face of the photoelectric element on the light receiving side thereof is easily affected by radiation noise. Hence, it is preferable that an electromagnetic shield covering the side face of the photoelectric element on the light receiving side thereof is provided to prevent erroneous detection of an object to be detected and to prevent malfunction of the photoelectric sensor. In the photoelectric sensor described in Patent Document 1, a ground-level shielding pattern face is formed as an electromagnetic shield on the face of the circuit board on the side of the condensing lens, that is, around the through hole on the face of the circuit board on the opposite side on which the photoelectric element is mounted. Furthermore, in the photoelectric sensor described in Patent Document 1, the photoelectric element is mounted on the face of the circuit board on the opposite side of the condensing lens, and the shielding pattern face is formed on the face of the circuit board on the side of the condensing lens, whereby the photoelectric sensor is made compact in comparison with the case in which a metal shield case serving as an electromagnetic shield is fixed to the circuit board.